# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=lumina-desktop
pkgver=1.6.2
pkgrel=0
pkgdesc="Lumina desktop environment"
options="!check" #no tests available
url="https://lumina-desktop.org/"
arch="all"
license="BSD-3-Clause"
depends="
	$pkgname-core
	$pkgname-coreutils
	$pkgname-archiver
	$pkgname-fileinfo
	$pkgname-fm
	$pkgname-mediaplayer
	$pkgname-photo
	$pkgname-screenshot
	$pkgname-sudo
	$pkgname-textedit
"
makedepends="qt5-qtbase-dev qt5-qtx11extras-dev qt5-qtsvg-dev
	qt5-qtmultimedia-dev qt5-qttools-dev xcb-util-wm-dev xcb-util-image-dev
	libxcursor-dev qt5-qtdeclarative-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/lumina-desktop/lumina/archive/v$pkgver.tar.gz"
builddir="$srcdir/lumina-$pkgver"
subpackages="$depends $pkgname-doc"

build() {
	qmake-qt5 QMAKE_CFLAGS_ISYSTEM= \
		PREFIX=/usr \
		LIBPREFIX=/usr/lib \
		QT5LIBDIR=/usr/lib/qt5 \
		L_MANDIR=/usr/share/man \
		L_ETCDIR=/etc \
		CONFIG+=WITH_I18N
	make
}

package() {
	make INSTALL_ROOT="$pkgdir" install
}

core() {
	pkgdesc="Lumina desktop core components"
	depends="libxcb xinit fluxbox xscreensaver xterm xbacklight pavucontrol acpi dbus"
	amove usr/share/lumina-desktop/*.ogg
	amove usr/share/lumina-desktop/*.jpg
	amove usr/share/lumina-desktop/*.png
	amove usr/share/lumina-desktop/*.conf
	amove usr/share/lumina-desktop/fluxbox*
	amove usr/share/lumina-desktop/theme.cfg
	amove usr/share/lumina-desktop/screensavers
	amove usr/share/icons
	amove etc

	amove usr/share/lumina-desktop/i18n/lumina-desktop*
	amove usr/share/xsessions/Lumina-DE.desktop
	amove usr/bin/lumina-desktop

	amove usr/share/lumina-desktop/i18n/lumina-info*
	amove usr/share/applications/lumina-info.desktop
	amove usr/share/applications/lumina-support.desktop
	amove usr/bin/lumina-info

	amove usr/share/lumina-desktop/i18n/lumina-open*
	amove usr/bin/lumina-open

	amove usr/bin/start-lumina-desktop

	amove usr/share/lumina-desktop/menu-scripts
	amove usr/share/lumina-desktop/themes
	amove usr/share/lumina-desktop/globs2

	amove usr/lib
	amove usr/share/lthemeengine
	amove usr/share/applications/lthemeengine.desktop
	amove usr/bin/lthemeengine*

	amove usr/bin/lumina-pingcursor
}

coreutils() {
	pkgdesc="Lumina desktop core utilities"
	depends="xrandr"

	amove usr/bin/lumina-config
	amove usr/share/applications/lumina-config.desktop
	amove usr/share/lumina-desktop/i18n/lumina-config*

	amove usr/bin/lumina-search
	amove usr/share/applications/lumina-search.desktop
	amove usr/share/lumina-desktop/i18n/lumina-search*

	amove usr/bin/lumina-xconfig
	amove usr/share/applications/lumina-xconfig.desktop
	amove usr/share/lumina-desktop/i18n/lumina-xconfig*
}

archiver() {
	pkgdesc="Lumina desktop archiver"
	depends="tar"

	amove usr/bin/lumina-archiver
	amove usr/share/applications/lumina-archiver.desktop
	amove usr/share/lumina-desktop/i18n/l-archiver*
}

fileinfo() {
	pkgdesc="Lumina desktop fileinfo"
	depends=""

	amove usr/bin/lumina-fileinfo
	amove usr/share/applications/lumina-fileinfo.desktop
	amove usr/share/lumina-desktop/i18n/l-fileinfo*
}

fm() {
	pkgdesc="Lumina desktop fm"
	depends="$pkgname-archiver $pkgname-fileinfo"

	amove usr/bin/lumina-fm
	amove usr/share/applications/lumina-fm.desktop
	amove usr/share/lumina-desktop/i18n/lumina-fm*
}

mediaplayer() {
	pkgdesc="Lumina desktop media player"
	depends="pianobar"

	amove usr/bin/lumina-mediaplayer
	amove usr/share/applications/lumina-mediaplayer.desktop
	amove usr/share/applications/lumina-mediaplayer-pandora.desktop
	amove usr/share/lumina-desktop/i18n/l-mediap*
}

photo() {
	pkgdesc="Lumina desktop photo"
	depends=""

	amove usr/bin/lumina-photo
	amove usr/share/applications/lumina-photo.desktop
	amove usr/share/lumina-desktop/i18n/l-photo*
}

screenshot() {
	pkgdesc="Lumina desktop screenshot"
	depends=""

	amove usr/bin/lumina-screenshot
	amove usr/share/applications/lumina-screenshot.desktop
	amove usr/share/lumina-desktop/i18n/l-screenshot*
}

sudo() {
	pkgdesc="Lumina sudo"
	depends=""

	amove usr/bin/lumina-sudo
}

textedit() {
	pkgdesc="Lumina desktop textedit"
	depends=""

	amove usr/bin/lumina-textedit
	amove usr/bin/lte
	amove usr/share/lumina-desktop/syntax_rules/*
	amove usr/share/applications/lumina-textedit.desktop
	amove usr/share/lumina-desktop/i18n/l-te*
}

sha512sums="
0bebdc89644af49232ad9a0b753dee501f3e99d6615ce926c71790932d228e3c6676ca4835aeaf6badf5455102278261e48bed0d3004fe9209aca68d620cae02  lumina-desktop-1.6.2.tar.gz
"
